<?php
class TimkiemController extends Controller
{
    public function timdienthoai()
    {
        $result = $this->_model->getKetQua($_GET);
        $dt = new Dienthoai();
        foreach ($result as &$row) {
            $row['dt_image_url'] = $dt->getDienthoaiFirstImage($row['dt_id']);

            Dienthoai::format($row);
        }

        $this->assign('list_ketqua', $result);
    }

    public function timkiemchung()
    {
        $data = $this->_model->search($_GET);

        $dt = new Dienthoai();
        foreach ($data as &$row) {
            $row['dt_image_url'] = $dt->getDienthoaiFirstImage($row['dt_id']);
            Dienthoai::format($row);

        }
        $this->assign('list_ketqua', $data);


    }
}